package java56_6;

import java.util.Scanner;

public class Arr2 {

	public static void main(String[] args) {
		// 一个个给数组赋值
		int ar[] = new int[10];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < ar.length; i++) {
			System.out.println("请输入数组的第" + (i + 1) + "个值：");
			ar[i] = sc.nextInt();
		}
		int sum = 0;
		for (int i = 0; i < ar.length; i++) {
			sum += ar[i];
		}
		System.out.println("和是" + sum);
		for (int k : ar) {
			System.out.println(k);
		}

		// for (int i = 0; i < ar.length; i++)
		// System.out.print(i + "==" + ar[i] + "\n");
		// }

	}

}
